import { Message, Notification } from 'element-ui'

// 提交数据之后页面反馈
export function allSubmitAlert (method) {
    return new Promise((resolve,reject) =>{
        Promise.all(method).then(resData =>{
            let dataList = [];
            resData.map(item=>{
                let depArr=[]
                if (item.code == 1){
                    item.data.map(item1=>{
                        depArr.push({
                            label: item1.dicLabel,
                            value: item1.dicValue
                        })
                    })
                }else{
                    Message.error('操作失败')
                    reject('错误')
                }
                dataList.push(depArr)
            })

            resolve(dataList)
            }).catch(error=>{
            Message.error('操作失败')
            reject('请求失败')
        });
    })
}
